<template>
  <div class="box">
    <h4 style="color: #1ba9ba">今日热门出发到达城市</h4>
    <div id="piethree">
     
    </div>
 </div>
</template>

<script setup>
import * as echarts from 'echarts';
import { onMounted } from 'vue';

onMounted(()=>{
var chartDom = document.getElementById('piethree');
var myChart = echarts.init(chartDom);
var option;

option = {
  legend: {
    top: '5%',
    itemHeight: 8,
    itemWidth: 8,
    left: 'center',
    icon: "circle",
     width:240
  },
  series: [
    {
      name: 'Access From',
      type: 'pie',
      radius: ['40%', '60%'],
      top:30,
      label: {
        show: false,
        position: 'center'
      },

      data: [
        { value: 1048, name: '三亚' },
        { value: 735, name: '深圳' },
        { value: 580, name: '北京' },
        { value: 1048, name: '上海' },
        { value: 735, name: '武汉' },
        { value: 580, name: '香港' },
        { value: 1048, name: '澳门' },
        { value: 735, name: '成都' },
        { value: 580, name: '桂林' },
        { value: 580, name: '哈尔滨' },
      ],
      color: ['#de799b', '#ff8d41','#ff8d41','#84d36e','#1ba9ba','#679cf6','#679cf6','#535fd8','#b2b7c6'],
    }
  ]
};

option && myChart.setOption(option);

    })
</script>

<style scoped lang="scss">
.box{
  text-align: center;
  padding: 10px;
}
#piethree{
    width: 400px;
    height: 200px;
}
</style>